package sky.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sky.dao.CardDAO;
import sky.domain.Card;
import sky.service.CardService;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 09.05.13
 * Time: 17:55
 * To change this template use File | Settings | File Templates.
 */
@Service
public class CardServiceImpl implements CardService {

    @Autowired
    private CardDAO cardDAO;

    @Override
    @Transactional
    public void addCard(Card card) {
        cardDAO.addCard(card);
    }

    @Override
    @Transactional
    public void removeCard(Integer id) {
        cardDAO.removeCard(id);
    }

    @Override
    @Transactional
    public Card getCardByCardId(Integer cardId) {
        return (Card) cardDAO.getCardByCardId(cardId);
    }
}
